package com.win.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

class Color {
}
@Configuration
public class MyConfig {
    // 当激活 prod 环境时，创建 red Bean
    @Profile("prod")
    @Bean
    public Color red() {
        return new Color();
    }

    // 当激活 test 环境时，创建 green Bean
    @Profile("test")
    @Bean
    public Color green() {
        return new Color();
    }
}